const common = require('../../webpack.common');

const IS_PROD = process.env.NODE_ENV === 'production';

const config = common({
    entry: {
        app: './main.js'
    }
}, {
    appPath: __dirname,
    addDLLReference: true,
    getPostCSSConfig() {
        return [
            require('postcss-inline-svg')({
                removeFill: false
            }),
            require('postcss-pxtorem')({
                replace: IS_PROD,
                rootValue: 750 / 16,
                minPixelValue: 1.1,
                propWhiteList: [],
                unitPrecision: 5
            }),
            require('autoprefixer')({
                browsers: ['last 7 versions']
            })
        ];
    }
});

// add hotcss resolve
config.resolve.alias.hotcss = `${__dirname}/lib/hotcss.js`;

module.exports = config;
